package com.xnx.bincker.leader.exception.data;

import com.xnx.bincker.leader.exception.SystemException;

/**
 * 数据异常
 */
public class DataException extends RuntimeException implements SystemException {
    private int code;
    private String tip;

    protected DataException(int code, String message, String tip, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.tip = tip;
        assert code < 1000;
    }

    @Override
    public int getCode() {
        return 1000 + code;
    }

    @Override
    public String getTip() {
        return tip;
    }
}
